#!/usr/bin/env python
import numpy as np
from scipy import sparse as sp
import sys


A = np.mat([[ 0, 8, 0],
			[ 8, 1, 4],
			[ 0, 4, 1]])

S = sp.coo_matrix(A)
print ("COO")
print (S.row)

for i,j,v in zip(S.row, S.col, S.data) :
	print (v)

S = S.tolil()
print ("LIL")

for el in zip(S.rows, S.data) :
	print (el[0])
	
S = sp.csr_matrix( sp.triu(A) )
print ("CSR")
print (S)

values = S.data
print ("val: " + str(values))
col_indices = S.indices
print ("col: " + str(col_indices))
row_pointers = S.indptr
print ("row: " + str(row_pointers))


#curr = -1
#for row in row_pointers :
#	for i, col_idx in enumerate( col_indices ):
#		if col > curr :
#			
#			